package com.wyl.auth.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wyl.auth.config.security.SecurityUser;
import com.wyl.auth.dto.SysUserDto;
import com.wyl.auth.dto.SysUserRoleDto;
import com.wyl.auth.entity.SysUser;
import com.wyl.auth.req.ResetPasswordReq;
import com.wyl.auth.req.SysUserReq;
import com.wyl.auth.vo.CurrentUserVo;
import com.wyl.auth.vo.SysUserVo;
import com.wyl.auth.vo.UserPermissionVo;
import com.wyl.common.CommonPage;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
* @Description 系统用户
* @Author WuYiLong
* @Date 2024-12-21
*/
public interface SysUserService extends IService<SysUser> {

    /**
     * 根据用户名查询
     * @param username
     * @return
     */
    SysUserVo getByUsername(String username);

    /**
     * 保存用户
     * @param sysUserDto
     */
    void saveUser(SysUserDto sysUserDto);

    /**
     * 分页
     * @param sysUserReq
     * @return
     */
    CommonPage<SysUserVo> pageUser(SysUserReq sysUserReq);

    /**
     * 删除用户
     * @param ids
     */
    void deleteUserByIds(List<Long> ids);

    /**
     * 导出用户
     * @param sysUserReq
     * @param response
     */
    void exportUser(SysUserReq sysUserReq, HttpServletResponse response);

    /**
     * 重置密码
     * @param id
     */
    String resetPassword(Long id);

    /**
     * 获取当前登录用户
     * @return
     */
    CurrentUserVo getCurrentUser();

    /**
     * 分配角色
     */
    void assignRole(SysUserRoleDto dto);

    /**
     * 根据用户id获得角色列表
     * @param userId
     * @return
     */
    List<Long> listRolesByUserId(Long userId);

    /**
     *
     * @param req
     */
    void resetPassword(ResetPasswordReq req);
}
